{extends file='layout/main.html'}
{block name="main"}
<div class="main_title">
	
	{if $smarty.session.type == 0}
	<h2>sn收费列表</h2>
	<p>sn收费列表及管理</p>
	{else}
	<h2>sn免费列表</h2>
	<p>sn免费列表及管理</p>
	{/if}
</div>
<div class="btn_blk">
	<div class="fr">
		{if $smarty.session.type == 0}
		<a href="?url=snabout/index&type=1&open_id={$smarty.session.open_id}" class="btn1 fr">免费sn</a>
		<a href="#" class="btn1 fr">收费sn</a>
		
		{/if}
		{if $smarty.session.type == 1}
		<a href="#" class="btn1 fr">免费sn</a>
		<a href="?url=snabout/index&type=0&open_id={$smarty.session.open_id}" class="btn1 fr">收费sn</a>
		
		{/if}
	</div>
</div>
<form action="?url=administrator/delete" method="post" accept-charset="utf-8" id="res_del">

<table width="100%" class="table_list">
	<tr>
		<th>sn_key</th>
		<th>type</th>
		<th>创建时间</th>
		<th>使用时间</th>
	</tr>
	
	{if $smarty.session.open_id == 0}
	{foreach $aluse as $val}
	<tr{if $val@iteration % 2} class="odd"{/if}>
		
		<td>{$val.sn_key}</td>
		<td>{$val.type}</td>
		<td>{$val.add_time}</td>
		<td>{$val.use_time}</td>
	</tr>
	{/foreach}
	{/if}
	{if $smarty.session.open_id == 1}
			{foreach $nouse as $val}
	<tr{if $val@iteration % 2} class="odd"{/if}>
		
		<td>{$val.sn_key}</td>
		<td>{$val.type}</td>
		<td>{$val.add_time}</td>
		<td>{$val.use_time}</td>
	</tr>
			{/foreach}
	{/if}
	{if $smarty.session.open_id == 2}
			{foreach $faluse as $val}
	<tr{if $val@iteration % 2} class="odd"{/if}>
		
		<td>{$val.sn_key}</td>
		<td>{$val.type}</td>
		<td>{$val.add_time}</td>
		<td>{$val.use_time}</td>
	</tr>
			{/foreach}
	{/if}
	{if $smarty.session.open_id == 3}
			{foreach $onuse as $val}
	<tr{if $val@iteration % 2} class="odd"{/if}>
		
		<td>{$val.sn_key}</td>
		<td>{$val.type}</td>
		<td>{$val.add_time}</td>
		<td>{$val.use_time}</td>
	</tr>
			{/foreach}
	{/if}
</table>
</form>
<div class="btn_blk">
	<div class="fr">
	{if $smarty.session.type == 0}
	{if $smarty.session.type == 0 and $smarty.session.open_id != 1}	
		<a href="?url=snabout/usee&type=0&open_id=1" class="btn1 fr">未使用</a>
		<a href="?url=snabout/usee&type=0&open_id=0" class="btn1 fr">已使用</a>	
	{else}
		<a href="?url=snabout/create&type=0" class="btn1 fr">添加sn</a>
	{/if}
	{/if}
	
	{if $smarty.session.type == 1}
	{if $smarty.session.type == 1 and $smarty.session.open_id != 3}
		<a href="?url=snabout/usee&type=1&open_id=3" class="btn1 fr">未使用</a>
		<a href="?url=snabout/usee&type=1&open_id=2" class="btn1 fr">已使用</a>
	{else}
		<a href="?url=snabout/create&type=1" class="btn1 fr">添加sn</a>
	{/if}
	{/if}
	</div>
	{include file="lib/pager.html"}

</div>

{/block}
